home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr44 / 2m30src.zip / 2MBOOTDD.INC < prev    next >
Text File  |  1995-03-06  |  4KB  |  88 lines

  1.  
  2. ;┌───────────────────────────────────────────────────────────────────┐
  3. ;│                                                                   │
  4. ;│     2MBOOTDD 3.0  -  (C) 1993-1995  Ciriaco García de Celis.      │
  5. ;│                                                                   │
  6. ;│         Con código del sector de arranque para discos DD.         │
  7. ;│                                                                   │
  8. ;└───────────────────────────────────────────────────────────────────┘
  9.  
  10.                CLI
  11.                XOR   AX,AX
  12.                MOV   SS,AX
  13.                MOV   SP,7C00h          ; SS:SP inicializado
  14.                MOV   AX,07C0h
  15.                PUSH  AX
  16.                PUSH  AX
  17.                POP   DS
  18.                POP   ES
  19.                MOV   SI,0000h
  20.                MOV   DI,0200h
  21.                MOV   CX,0100h
  22.                CLD
  23.                REP   MOVSW             ; auto-reubicar este código
  24.                MOV   AX,07E0h
  25.                PUSH  AX
  26.                PUSH  AX
  27.                PUSH  AX
  28.                POP   DS
  29.                POP   ES
  30.                MOV   BX,DS:[68]        ; constante de reubicación
  31.                LEA   AX,[BX+OFFSET boot_inidd - OFFSET _BootDDPrg]
  32.                PUSH  AX
  33.                RETF                    ; saltar a boot_inidd reubicado
  34. boot_inidd:    STI
  35.                MOV   BX,DS:[68]        ; constante de reubicación
  36.                PUSH  BX                ; *
  37.                LEA   BX,[BX+OFFSET info_txtdd - OFFSET _BootDDPrg]
  38.                CALL  printdd
  39.                MOV   AH,0
  40.                INT   16h               ; esperar por una tecla
  41.                POP   BX                ; *
  42.                LEA   BX,[BX+OFFSET crlf_txtdd - OFFSET _BootDDPrg]
  43.                CALL  printdd
  44.                XOR   AX,AX
  45.                MOV   ES,AX
  46.                MOV   BX,7C00h          ; ES:BX = 0000:7C00
  47.                MOV   AX,0201h          ; leer un sector
  48.                MOV   CX,0001h          ; el sector 1 del cilindro 0
  49.                MOV   DX,0080h          ; y cabezal 0 del disco duro
  50.                PUSH  ES
  51.                PUSH  BX
  52.                INT   13h               ; cargar tabla de particiones
  53.                JNC   rd_okdd
  54.                CMP   AH,11h            ; ¿error ECC corregido?
  55.                JNE   err_bootdd
  56. rd_okdd:       CMP   WORD PTR ES:[7DFEh],0AA55h
  57.                JNE   err_bootdd
  58.                XOR   AX,AX
  59.                MOV   DS,AX
  60.                RETF                    ; ejecutar tabla de particiones
  61. err_bootdd:    MOV   BX,DS:[68]
  62.                LEA   BX,[BX+OFFSET noboot_txtdd - OFFSET _BootDDPrg]
  63.                CALL  printdd
  64.                MOV   AX,40h
  65.                MOV   DS,AX
  66.                MOV   WORD PTR DS:[72h],1234h  ; evitar chequeo memoria
  67.                MOV   AH,0
  68.                INT   16h                      ; esperar tecla
  69.                DB    0EAh
  70.                DW    0, 0FFFFh                ; jmp ffff:0000
  71. printdd:       MOV   AL,[BX]
  72.                AND   AL,AL             ; carácter 0: fin del mensaje
  73.                JNZ   print_cardd
  74.                RET
  75. print_cardd:   PUSH  BX
  76.                MOV   AH,0Eh
  77.                MOV   BX,7
  78.                INT   10h               ; imprimir carácter
  79.                POP   BX
  80.                INC   BX
  81.                JMP   printdd
  82.  
  83. info_txtdd     DB    13,10,"2M 3.0",13,10
  84.                DB    " - Disquete DD: Pulsa una tecla para botar del disco duro...",13,10
  85.                DB    " - DD diskette: Press any key to boot from your hard disk...",0
  86. noboot_txtdd   DB    " ¡Error!: Pulsa una tecla - Press any key...",0
  87. crlf_txtdd     DB    13,10,10,0
  88.